[Bugfix][TE] Roll back failed native notification setup - #4330
Open
waizuichougou wants to merge 1 commit into
Open
waizuichougou wants to merge 1 commit into
waizuichougou wants to merge 1 commit into
Conversation
waizuichougou
requested review from
alogfans,
chestnut-Q,
doujiang24 and
staryxchen
as code owners
September 26, 2026 00:59
he-yufeng
reviewed
Sep 26, 2026
he-yufeng
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed line by line and ran the suite in the repo container (mc-dev:local, endpoint_store_test built from this head): 8/8 pass, including both new rollback tests; the EBUSY log lines in the retention test are the probes doing their job.
Mechanism checks beyond the suite:
- Every failure site in constructNotification now rolls back (no notify CQ, QP create, QP INIT modify, MR reg, post-recv mid-loop), and the ordering is right: fail() records the error state first, then cleanup runs, so waiters wake into a coherent state.
- The partial-failure semantics match the existing destructor philosophy: on cleanup error the resource stays tracked and enabled stays true, so ~RdmaEndPoint's retain-on-teardown-failure path still owns it.
- Retry consistency holds: a later constructNotification() resets error/enabled at the top, so a fully rolled-back endpoint re-constructs cleanly.
- Locking is sound: rollback runs inside the construct's notify_.mutex scope; the test peer takes the same lock for its probes.
One nit, not blocking: the tests drive rollbackNotificationConstruction directly through injected ops, so the wiring from each real failure site (that every s.fail path actually calls rollback) is read-verified only. Injecting a failing ibv_create_qp would cover that too, but the failure arms are simple enough that I would not gate on it.
Looks right to me.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
follow up #4214, when native RDMA notification setup was added without rollback for partial verbs
resource initialization.
Native RDMA notification setup can leave partially initialized verbs resources
behind when QP creation, QP initialization, MR registration, or receive WR
posting fails. These resources remain attached to the endpoint until endpoint
destruction, which can retain QPs, MRs, and buffers during repeated setup
failures.
This change adds rollback cleanup for failed notification construction and
verifies that the failure path releases all resources that were acquired.
Changes
cleanup retention.
Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
Test results:
executed. Hardware-independent notification protocol tests passed; RDMA
device-dependent cases were skipped when no usable RDMA device was present.
Results:
endpoint_store_test: 8/8 tests passed, including notification resourcerollback and cleanup-failure retention cases.
rdma_native_notify_test: 2 tests passed; 16 RDMA-dependent tests skipped.Checklist
./scripts/code_format.shAI Assistance Disclosure
AI assistance was used for this contribution.